<template>
  <div class="app-container">
    <div class="filter-container" >
      <!--<div style="height: 30px;">
        <span>营业汇总表</span>
      </div>-->
      <searchBar @searchEvent= "handleFilter"/>
    </div>
    <div style="height: 50px;margin-top: 20px;padding: 0 12px; background:#eee; line-height: 50px;">
      <span>品牌菜品报表</span>
      <el-button v-waves style="float: right; margin-top: 7px;" class="filter-item" type="primary" @click="download">月报表</el-button>
    </div>
    <el-table
      v-loading="listLoading"
      :key="tableKey"
      :data="overAll"
      __height="500px"
      border
      fit
      highlight-current-row
      style="width: 100%;"
    >
      <el-table-column label="品牌名称" fixed align="center" >
        <template slot-scope="scope">
          <span>{{ scope.row.id }}</span>
        </template>
      </el-table-column>
      <el-table-column label="菜品总销量" fixed align="center" width="120">
        <template slot-scope="scope">
          <span>{{ scope.row.paymentAmountSum && scope.row.paymentAmountSum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="菜品销售总额" width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.weChatPaySum && scope.row.weChatPaySum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="菜品实收总额" width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.aliPaySum && scope.row.aliPaySum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="折扣总额" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.accountBalancePaySum && scope.row.accountBalancePaySum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退菜总数" width="110px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.unionPaySum && scope.row.unionPaySum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退菜总额" width="80px" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.groupBuyingPaySum && scope.row.groupBuyingPaySum || 0 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="赠菜总数" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.row.author }}</span>
        </template>
      </el-table-column>
      <el-table-column label="赠菜总额" align="center" >
        <template slot-scope="scope">
          <span>{{ scope.row.author }}</span>
        </template>
      </el-table-column>
    </el-table>

    <div style="height: 50px;margin-top: 20px;padding: 0 12px; background:#eee; line-height: 50px;">
      <span>品牌菜品汇总表</span>
      <el-button v-waves style="float: right; margin-top: 7px;" class="filter-item" type="primary" @click="download">月报表</el-button>
    </div>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="单品" name="first">
        <el-table
          v-loading="listLoading"
          :key="tableKey"
          :data="list"
          height="550"
          border
          fit
          highlight-current-row
          style="width: 100%;"
        >
          <el-table-column label="店铺名称" fixed min-width="150" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="用户消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户渠道" min-width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="自然用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="分享用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="二次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="多次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="套餐" name="second">
        <el-table
          v-loading="listLoading"
          :key="tableKey"
          :data="list"
          height="550"
          border
          fit
          highlight-current-row
          style="width: 100%;"
        >
          <el-table-column label="店铺名称" fixed min-width="150" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="用户消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户渠道" min-width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="自然用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="分享用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="二次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="多次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="类别" name="third">
        <el-table
          v-loading="listLoading"
          :key="tableKey"
          :data="list"
          height="550"
          border
          fit
          highlight-current-row
          style="width: 100%;"
        >
          <el-table-column label="店铺名称" fixed min-width="150" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="用户消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户渠道" min-width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="自然用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="分享用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="二次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="多次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <el-tab-pane label="其他销量" name="fourth">
        <el-table
          v-loading="listLoading"
          :key="tableKey"
          :data="list"
          height="550"
          border
          fit
          highlight-current-row
          style="width: 100%;"
        >
          <el-table-column label="店铺名称" fixed min-width="150" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="用户消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.id }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头消费比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户比率" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新增用户渠道" min-width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="新用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="自然用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="分享用户" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="回头用户消费" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="二次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
          <el-table-column label="多次回头" width="120" align="center" >
            <template slot-scope="scope">
              <span>{{ scope.row.author }}</span>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
    <!--<pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" layout="total, sizes, prev, pager, next, jumper"  />-->

  </div>
</template>

<script>
// import { fetchList } from '@/api/article'
import waves from '@/directive/waves' // Waves directive
import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination

import searchBar from '@/pages/common/searchBar'
import ReportSearchMixin from '@/pages/common/mixin/ReportSearch.js'

export default {
  name: 'Shishoumingxi',
  components: { searchBar, Pagination },
  directives: { waves },
  filters: {

  },
  mixins: [ReportSearchMixin],
  data() {
    return {
      beginDate: parseTime(new Date().getTime(), '{y}-{m}-{d} 00:00:00'),
      endDate: parseTime(new Date().getTime(), '{y}-{m}-{d}'),
      tableKey: 0,
      list: [],
      total: 0,
      listLoading: true,
      listQuery: {
        pageNum: 1,
        pageSize: 10
      },
      overAllUrl: '/service-report/businessReport/listRealReport', // 概览接口地址
      // listUrl: '/service-report/data/ShopList', // 列表接口地址
      activeName: 'first'
    }
  },
  created() {

  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
    },
    download() {

    }

  }
}
</script>
